<table class="table table-bordered table-striped table-hover">
    <thead>
        <tr>
            <th>#</th>
            <th>{{i18n-adsNums}}</th>
            <th>{{i18n-optimizationTime}}</th>
        </tr>
    </thead>
    <tbody class="text-center">
        <% for(var i=0;i<d.length;i++){ %>
            <% var data = d[i]; %>
                <tr data-ownid="log-id-<%=data.id%>">
                    <th scope="row" class="text-center">
                        <%=(i+1)%>
                    </th>
                    <td>
                        <%=data.adActionRecords.length%>
                    </td>
                    <td>
                        <%=data.optTime%>
                    </td>
                </tr>
                <tr id="log-id-<%=data.id%>" class="hidden">
                    <td colspan="3">
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th style="width: 20px;">{{i18n-adId}}</th>
                                    <th style="width: 100px;">{{i18n-action}}</th>
                                    <th style="width: 100px;">{{i18n-ManualAutomatic}}</th>
                                    <th>{{i18n-reasons}}</th>
                                </tr>
                            </thead>
                            <tbody class="text-center">
                                <% for(var j=0;j<data.adActionRecords.length;j++){ %>
                                    <% var ad = data.adActionRecords[j]; %>
                                        <tr>
                                            <th scope="row" class="text-center" data-adid="<%=ad.adId%>">
                                                <%=ad.adId%>
                                            </th>
                                            <td>
                                                <%=ad.action%>
                                            </td>
                                            <td>
                                                <%=(ad.isManual)?(I18N.getText('adOptimize','Manual')):(I18N.getText('adOptimize','Automatic'))%>
                                            </td>
                                            <td>
                                                <ul>
                                                    <% _.each(ad.attributions,function (attr,i) { %>
                                                        <li>
                                                            <%=(I18N.getText('adOptimize','reasons'))%>:"<%=attr.attribution%>"
                                                            <%=(I18N.getText('adOptimize','action'))%>:"<%=attr.optimizingType%>"
                                                        </li>
                                                        <% }) %>
                                                </ul>
                                            </td>
                                        </tr>
                                        <% } %>
                            </tbody>
                        </table>
                    </td>
                </tr>
                <% } %>

    </tbody>
</table>